
/**
* 设置本地localStorage
* @name {String} 数据对象的KEY
* @data {all} 对应key的数据
*/
export function setStorage(name, data) {
    let storage = window.localStorage;
    storage.setItem(name, JSON.stringify(data));
  }
   
  /**
  * 拿到本地localStorage
  * @name {String} 数据对象的KEY
  */
  export function getStorage(name) {
    let storage = window.localStorage;
    let data = JSON.parse(storage.getItem(name));
    return data;
  }
  /**
  * 设置本地sessionStorage
  * @name {String} 数据对象的KEY
  * @data {all} 对应key的数据
  */
  export function setSessionStorage(name, data) {
    let storage = window.sessionStorage;
    storage.setItem(name, JSON.stringify(data));
  }
   
  /**
  * 拿到本地sessionStorage
  * @name {String} 数据对象的KEY
  */
  export function getSessionStorage(name) {
    let storage = window.sessionStorage;
    let data = JSON.parse(storage.getItem(name));
    return data;
  }